import functools


def generator(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        print("装饰前的操作")
        result = func(*args, **kwargs)
        print("装饰后的操作")
        return result

    return wrapper


@generator
def wheat():
    print("heat")
    print("cheat")
    print("wheat")


if __name__ == '__main__':
    wheat()
